/*******************************************************************************
generate coefficient plots of the falsification tests related to war outcomes
standardize instrumemnt
*******************************************************************************/

clear all
set matsize 800
set more off

use "${datapath}/fascism_db.dta",clear

* standardize dependent and independent vars
foreach var of varlist fascist_violence-strike_agr_1920 lpop1911-volunteers1866_pop rain1918-rain_var {
egen z_`var'=std(`var')
}

* relabel them
run "labels.do"


eststo clear

****CONTROLS
local demo "z_lpop1911 z_lpop2 z_lpop3 z_lpop4 z_sh_pop_1911_be6"
local geo "z_larea z_centre_alt z_max_alt"
local rural "z_dlab z_shcrop z_landlord_ass"
local urban "z_ind_workers z_ind_firms z_literacy z_elites z_bourgeoisie"
local urban_literacy "z_ind_workers z_ind_firms z_elites z_bourgeoisie"
local urban_ind_firms "z_ind_workers z_literacy z_elites z_bourgeoisie"
local urban_ind_workers "z_ind_firms z_literacy z_elites z_bourgeoisie"
local corps "z_ard_vol_pop6m z_cruent_d z_veterans74_95 z_veterans96_00 z_army_suppliers_d"
local corps_no_ard "z_volunt_pop6m z_cruent_d z_veterans74_95 z_veterans96_00 z_army_suppliers_d"
local corps_no_vol "z_arditi_pop6m z_cruent_d z_veterans74_95 z_veterans96_00 z_army_suppliers_d"
local corps_no_ard_vol_pop6m "z_cruent_d z_veterans74_95 z_veterans96_00 z_army_suppliers"

*** first stage
eststo fs_1: qui reg z_psu1919_vv z_foots_pop6m `demo' d_reg* province* , cl(circondario1921)
eststo fs_2: qui reg z_psu1919_vv z_foots_pop6m `demo' `geo' z_psu1913_vv `corps' d_reg* province* , cl(circondario1921)
eststo fs_3: qui reg z_psu1919_vv z_foots_pop6m `demo' `geo' z_psu1913_vv `corps' `rural' `urban' d_reg* province* , cl(circondario1921)
***
foreach i in fascist1919_vv nationalist1919_vv monuments1921_pop monuments1921d {
eststo `i'_1: qui reg z_`i' z_foots_pop6m `demo' d_reg* province* ,cl(circondario1921)
eststo `i'_2: qui reg z_`i' z_foots_pop6m `demo' `geo' z_psu1913_vv `corps' d_reg* province* ,cl(circondario1921)
eststo `i'_3: qui reg z_`i' z_foots_pop6m `demo' `geo' z_psu1913_vv `corps' `rural' `urban' d_reg* province* ,cl(circondario1921)
}
foreach i in  volunt_pop6m {
eststo `i'_1: qui reg z_`i' z_foots_pop6m `demo' d_reg* province* ,cl(circondario1921)
eststo `i'_2: qui reg z_`i' z_foots_pop6m `demo' `geo' z_psu1913_vv `corps_no_vol' d_reg* province* ,cl(circondario1921)
eststo `i'_3: qui reg z_`i' z_foots_pop6m `demo' `geo' z_psu1913_vv `corps_no_vol' `rural' `urban' d_reg* province* ,cl(circondario1921)
}
foreach i in arditi_pop6m  {
eststo `i'_1: qui reg z_`i' z_foots_pop6m `demo' d_reg* province* , cl(circondario1921)
eststo `i'_2: qui reg z_`i' z_foots_pop6m `demo' `geo' z_psu1913_vv `corps_no_ard' d_reg* province* , cl(circondario1921)
eststo `i'_3: qui reg z_`i' z_foots_pop6m `demo' `geo' z_psu1913_vv `corps_no_ard' `rural' `urban' d_reg* province* , cl(circondario1921)
}
foreach i in ard_vol_pop6m ard_vol_d{
eststo `i'_1: qui reg z_`i' z_foots_pop6m `demo' d_reg* province*  , cl(circondario1921)
eststo `i'_2: qui reg z_`i' z_foots_pop6m `demo' `geo' z_psu1913_vv `corps_no_ard_vol_pop6m' d_reg* province* , cl(circondario1921)
eststo `i'_3: qui reg z_`i' z_foots_pop6m `demo' `geo' z_psu1913_vv `corps_no_ard_vol_pop6m' `rural' `urban' d_reg* province* , cl(circondario1921)
}
*

#delim ;

coefplot 	fs_1 fs_2 fs_3,														bylabel(Socialists 1919 (First Stage)) ||
			fascist1919_vv_1 fascist1919_vv_2 fascist1919_vv_3, 				bylabel(Fascists 1919) ||
			nationalist1919_vv_1 nationalist1919_vv_2 nationalist1919_vv_3, 	bylabel(Nationalists 1919) ||
			monuments1921_pop_1 monuments1921_pop_2 monuments1921_pop_3, 		bylabel(Monuments Per Capita 1921) ||
			monuments1921d_1 monuments1921d_2 monuments1921d_3, 				bylabel(Monuments 1921 (Binary)) ||
			arditi_pop6m_1 arditi_pop6m_2 arditi_pop6m_3, 						bylabel(Arditi Casualties) ||
			volunt_pop6m_1 volunt_pop6m_2 volunt_pop6m_3,						bylabel(Volunteers Casualties) ||
			ard_vol_pop6m_1 ard_vol_pop6m_2 ard_vol_pop6m_3, 					bylabel(Arditi and Volunteers Casualties) ||
			ard_vol_d_1 ard_vol_d_2 ard_vol_d_3, 								bylabel(Arditi and Volunteers Casualties (Binary)) ||,
			
			bycoefs plotlabels("1st Specification" "4th Specification" "6th Specification") keep(z_foots_pop6m) xline(0) msymbol(s) msize(vsmall) ci(95) ciopts(recast(rcap))  plotregion(color(white)) xlabel(, nogrid) ylabel(, labsize(small)) xtitle(, size(small)) xscale(lcolor("black") fextend) yscale(lcolor("black")  fextend)   ysize(5.5) legend(off) legend(off) ;
			
#delim cr
 
graph export "${outpath}/fig6.png", width(4000) replace
